<!DOCTYPE html>
<html lang="en">
<head>
    <title>投诉</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="lib/layui/css/layui.css">
    <script src="lib/layui/layui.js"></script>
    <script src="lib/jquery-1.12.4.min.js"></script>
    <!--[if lte IE 9]>
    <script type='text/javascript' src='lib/jquery.xdomainrequest.min.js'></script>
    <script type='text/javascript' src='lib/json2.js'></script>
    <![endif]-->
    <script>
        document.write('<link rel="stylesheet" href="lib/common.css?t=' + new Date().getTime() + '">')
        document.write('<script src="lib/lib.js?t=' + new Date().getTime() + '"><\/script\>')
        document.write('<script src="lib/api.js?t=' + new Date().getTime() + '"><\/script\>')
    </script>
    <style>
        body{
            overflow: hidden;
        }
        .form-horizontal .control-group{
            margin-bottom: 0;
        }
        .form-horizontal .control-label{
            width: 100px;

        }
        .form-horizontal .controls{
            margin-left: 110px;
            border-bottom: 1px solid #ccc;
            height: 30px;
        }
        .form-horizontal .controls span{
            line-height: 30px;
        }
        table{
            width: 100%;
        }

        #statement{
            line-height: 30px;
            padding: 20px;
        }

        p{
            font-weight: bold;
            text-indent: 20px;
        }
        .redText{
            color: red;
        }
    </style>
</head>
<body>
    <form class="form-horizontal" style="margin-top: 10px;" id="form">
        <table>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="varieties">品种：</label>
                        <div class="controls">
                            <span id="varieties"></span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="textureMaterial">材质：</label>
                        <div class="controls">
                            <span id="textureMaterial"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="inputCode">规格：</label>
                        <div class="controls">
                            <span id="inputPhone"></span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="quantity">数量：</label>
                        <div class="controls">
                            <span id="quantity"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="place">产地：</label>
                        <div class="controls">
                            <span id="place"></span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="floorPrice">最低价格：</label>
                        <div class="controls">
                            <span id="floorPrice"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="company">公司名称：</label>
                        <div class="controls">
                            <span id="company"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="linkman">联系人：</label>
                        <div class="controls">
                            <span id="linkman"></span>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="phone">联系人电话：</label>
                        <div class="controls">
                            <span id="phone"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="updateTime">发布时间：</label>
                        <div class="controls">
                          <span id="updateTime"></span>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="remarks">备注：</label>
                        <div class="controls">
                            <span id="remarks"></span>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
        <div style="font-weight: bold;">
            <p style="text-align: center;line-height: 30px;">我要投诉此条信息</p>
            <table>
                <tr>
                    <td width="100" align="right">投诉理由</td>
                    <td>
                        <div style="padding-left: 10px;">
                            <textarea name="" id="complaintContent" style="width: 90%;height: 100px;resize: unset;"></textarea>

                            <div style="display: flex;margin-top: 5px;">
                                <input type="checkbox" id="checkbox">
                                <a  href="#" onclick="page.showStatement()">同意投诉申明</a>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>


        <div style="text-align: center;">
            <button type="button" class="btn" onclick="page.complaint()">我要投诉他</button>
        </div>
    </form>
    <div id="statement" style="display: none;">
        <p style="text-align: center;">投诉声明</p>
        <p>
            为了更好的为大家服务，净化网络杜绝虚假信息，本站从即日起(2007-1-6)开始实行虚假信息投诉制度。现制度规定如下:
        </p>
        <p>
            1.在会员发布的产品详细信息里添加了公司诚信度以表示该会员公司的诚信度
        </p>
        <p>
            2.起始每位会员有 <span class="redText">600</span>  信誉分，满分为 <span class="redText">1000</span>  分
        </p>
        <p>
            3.发现假信息可以在此条信息的详细信息里点击”我要投诉”进行投诉，如经过我们客服审核此条信息确实为虚假信息，那么我们会对发布虚假信息的会员减去 <span class="redText">50</span> 信誉分，并对举报虚假信息的会员加上 <span class="redText">10</span> 信誉分
        </p>
        <p>
            4.如发现某会员多次投诉的信息都为真实信息，我们将视此行为为恶意投诉他人的行为并对恶意投诉者减去恶意投诉条数乘以 <span class="redText">20</span> 的信誉分
        </p>
        <p>
            5.会员<span style="color: blue;text-decoration: underline;">有效登陆</span>一次加 <span class="redText">1</span> 信誉分
        </p>
       <p>
            6.本站不会公布投诉信息的处理结果，处理结果只会在RTX上通知发布虚假信息的会员或恶意投诉他人的会员
       </p>
       <p style="text-align: left;">
            <a href="#" onclick="page.hideStatement()">返回上一页</a>
        </p>
    </div>
<script type="text/javascript">
    var id = getUrlParams('id')
    var layer;

    layui.use(['layer'], function(){
        layer = layui.layer
        $(document).on('keydown', function(ev){
            if(ev.keyCode==27){
                var index = parent.layer.getFrameIndex(window.name)
                parent.layer.close(index)
            }
        })
    })
    var page = {
        showStatement: function(){
            $("#form").hide()
            $("#statement").show()
        },
        hideStatement: function(){
            $("#statement").hide()
            $("#form").show()
        },
        stockDetail: function(){
            var post = {
                id: id
            }
            api.stockDetail(post,function(res){
                if(res.code==200){
                    var data = res.data
                    $("#varieties").text(data.varieties)
                    $("#textureMaterial").text(data.textureMaterial)
                    $("#spec").text(data.spec)
                    $("#place").text(data.place)
                    $("#quantity").text(data.quantity)
                    $("#floorPrice").text(data.floorPrice)
                    $("#company").text(data.company)
                    $("#linkman").text(data.linkman)
                    $("#phone").text(data.phone)
                    $("#remarks").text(data.remarks)
                    $("#updateTime").text(data.updateTime)
                }
            })
        },
        complaint: function(){
            var complaintContent = $("#complaintContent").val()
            if(complaintContent==''){
                layer.tips('请输入投诉内容。', '#complaintContent', {
                    tips: [1, '#3595CC'],
                    time: 2000
                })
                return
            }
            var checked = $("#checkbox")[0].checked
            if(checked){
                var post = {
                    inStockId: id,
                    complaintContent: complaintContent
                }
                api.complaint(JSON.stringify(post),function (res){
                    if(res.code==200){
                        layer.msg('投诉成功')
                        setTimeout(function (){
                            location.reload()
                        },1000)
                    } else {
                        layer.msg(res.msg)
                    }
                })
            } else {
                layer.tips('请同意投诉申明。', '#checkbox', {
                    tips: [1, '#3595CC'],
                    time: 2000
                })
            }

        }

    }

    page.stockDetail()
</script>
</body>
</html>
